home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / bbbbs85.lha / rexx / Answer.baud next >
Text File  |  1992-07-13  |  2KB  |  88 lines

  1. /*    $VER: Answer.baud version 5.3  13 Jul 1992  (13.7.92)
  2. copyright 1990-91-92 Richard Lee Stockton FREELY DISTRIBUTABLE
  3. */
  4.  
  5. OPTIONS RESULTS
  6. SIGNAL ON BREAK_C
  7. CR='0D'x
  8.  
  9. /* If the QuickSortPort not found then try to run setup.rexx . */
  10.  
  11. IF ~show('P','QuickSortPort') THEN CALL setup.rexx();
  12.  
  13. /* If STILL not found then we gotta quit. */
  14.  
  15. IF ~show('P','QuickSortPort') THEN EXIT
  16.  
  17.  
  18. Send 'ATA\r'
  19. Timeout 45
  20. Wait 'CONNECT,NO CARRIER,RING'      /* wait 45 seconds for connect */
  21. IF RESULT~='CONNECT' THEN SIGNAL RESET
  22. CALL DELAY(150)
  23. Remote ON
  24. Queue CR
  25. SAY CR
  26. Timeout 60
  27. CALL DELAY(150) /* 3 second pause for error checking modems to get in sync */
  28. dcd
  29. IF RC=0 THEN SIGNAL BREAK_C
  30. SAY CR
  31. IF GETCLIP('BBS_maint')~='' THEN
  32.   DO
  33.     SAY 'The BBS is busy with periodic maintenance.'CR
  34.     SAY 'Please try again in a few minutes.'CR
  35.     SAY CR
  36.     SAY CR
  37.     SIGNAL BREAK_C
  38.   END
  39. CALL SETCLIP('BBS_QUIT')
  40. SAY '             Loading BBBBS... Thank you for your patience.'CR
  41. SAY CR
  42. SAY CR
  43. CALL BBBBS.baud();
  44. EXIT;
  45.  
  46.  
  47. BREAK_C:
  48. Remote OFF
  49.  
  50. RESET:
  51. Send '\d'
  52. CALL DELAY(100)
  53. Send '\ah'
  54. CALL DELAY(150)
  55. bps=GETCLIP('BBS_baud')
  56. IF bps='' THEN
  57.   DO
  58.     figarg='s:CONFIG.BBS'
  59.     IF ~EXISTS(figarg) THEN figarg='BBS:BBS_TEXT/CONFIG.BBS'
  60.     x=OPEN(f,figarg,'R')
  61.     IF x=0 THEN
  62.       DO
  63.         SAY 's:CONFIG.BBS and BBS:BBS/CONFIG.BBS are both missing!'
  64.         EXIT(20)
  65.       END
  66.     DO i=1 TO 15
  67.       line=READLN(f)
  68.     END
  69.     CALL CLOSE(f)
  70.     bps=WORD(line,1)
  71.     IF DATATYPE(bps,'N') THEN
  72.       DO
  73.         bps=bps%1
  74.         CALL SETCLIP('BBS_baud',bps)
  75.       END
  76.     ELSE
  77.       DO
  78.         SAY '*** Bad baud rate in 'figarg'!'
  79.         bps=2400
  80.       END
  81.   END
  82. baud bps
  83. Send 'ATZ\r'  /* reset modem */
  84. EXIT;
  85.  
  86.  
  87. /* end of Answer.baud */
  88.